package com.easyadmin.entity.enums;

import com.fasterxml.jackson.annotation.JsonFormat;

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum MethodTypeEnum {
    NO_PARAMS(0, "无参函数"), PARAMS(1, "有参函数");

    private Integer type;
    private String description;

    MethodTypeEnum(int type, String description) {
        this.type = type;
        this.description = description;
    }

    public Integer getType() {
        return type;
    }

    public String getDescription() {
        return description;
    }

    public static MethodTypeEnum getByType(Integer type) {
        for (MethodTypeEnum at : MethodTypeEnum.values()) {
            if (at.type.equals(type)) {
                return at;
            }
        }
        return null;
    }
}
